package com.khyr.feign;

import com.khyr.entity.HisPatient;
import com.khyr.entity.User;
import com.khyr.vo.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallbackFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable cause) {
        return new UserFeign() {
            @Override
            public R<User> getUserInfo(String token) {
                return new R<User>(500, "服务器故障", null);
            }

            @Override
            public R<HisPatient> getPatientInfo(String token) {
                return null;
            }
        };
    }
}
